/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.isn.atencionemergencia.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import com.isn.historiaclinica.entity.Distrito;
import com.isn.logueo.entity.Usuario;

@Entity
@Table(name = "animal_mordedor")
public class AnimalMordedor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "Cod_Ani", columnDefinition="CHAR(5) unsigned")
    private String codAni;
    @Column(name = "Nom_Ani")
    private String nomAni;
    @Column(name = "Nom_Propi")
    private String nomPropi;
    @Column(name = "Domi_Propi")
    private String domiPropi;
    @Column(name = "Ref_Domi_Propi")
    private String refDomiPropi;
    @Column(name = "Fecnac_Ani")
    @Temporal(TemporalType.DATE)
    private Date fecnacAni;
    @Column(name = "Sexo_Ani")
    private String sexoAni;
    @Column(name = "Tam_Ani")
    private String tamAni;
    @Basic(optional = false)
    @Column(name = "Fec_Reg")
    @Temporal(TemporalType.DATE)
    private Date fecReg;
    @Basic(optional = false)
    @Column(name = "tip_ope")
    private String tipOpe;
    @JoinColumn(name = "Usuario", referencedColumnName = "Usuario")
    @ManyToOne(optional = false,fetch=FetchType.LAZY)
    private Usuario usuario;
    @JoinColumn(name = "Cod_Raza", referencedColumnName = "Cod_Raza")
    @ManyToOne(optional = false,fetch=FetchType.LAZY)
    private Raza codRaza;
    @JoinColumn(name = "Cod_Especi", referencedColumnName = "Cod_Especi")
    @ManyToOne(optional = false,fetch=FetchType.LAZY)
    private Especie codEspeci;
    @JoinColumns({
        @JoinColumn(name = "Cod_Prov", referencedColumnName = "Cod_Prov", insertable = false, updatable = false),
        @JoinColumn(name = "Cod_Depa", referencedColumnName = "Cod_Depa", insertable = false, updatable = false),
        @JoinColumn(name = "Cod_Distri", referencedColumnName = "Cod_Distri", insertable = false, updatable = false)})
    @ManyToOne(optional = false,fetch=FetchType.LAZY)
    private Distrito codDistri;
    @JoinColumn(name = "Cod_Color", referencedColumnName = "Cod_Color")
    @ManyToOne(optional = false,fetch=FetchType.LAZY)
    private Color codColor;
    
    @JoinColumn(name = "num_oae", referencedColumnName = "Num_Oae")
    @ManyToOne(optional = false,fetch=FetchType.LAZY)
    private OrdenDeAtencionDeEmergencia numOae;

    public AnimalMordedor() {
    }

    public AnimalMordedor(String codAni) {
        this.codAni = codAni;
    }

    public AnimalMordedor(String codAni, Date fecReg, String tipOpe) {
        this.codAni = codAni;
        this.fecReg = fecReg;
        this.tipOpe = tipOpe;
    }

    public String getCodAni() {
        return codAni;
    }

    public void setCodAni(String codAni) {
        this.codAni = codAni;
    }

    public String getNomAni() {
        return nomAni;
    }

    public void setNomAni(String nomAni) {
        this.nomAni = nomAni;
    }

    public String getNomPropi() {
        return nomPropi;
    }

    public void setNomPropi(String nomPropi) {
        this.nomPropi = nomPropi;
    }

    public String getDomiPropi() {
        return domiPropi;
    }

    public void setDomiPropi(String domiPropi) {
        this.domiPropi = domiPropi;
    }

    public String getRefDomiPropi() {
        return refDomiPropi;
    }

    public void setRefDomiPropi(String refDomiPropi) {
        this.refDomiPropi = refDomiPropi;
    }

    public Date getFecnacAni() {
        return fecnacAni;
    }

    public void setFecnacAni(Date fecnacAni) {
        this.fecnacAni = fecnacAni;
    }

    public String getSexoAni() {
        return sexoAni;
    }

    public void setSexoAni(String sexoAni) {
        this.sexoAni = sexoAni;
    }

    public String getTamAni() {
        return tamAni;
    }

    public void setTamAni(String tamAni) {
        this.tamAni = tamAni;
    }

    public Date getFecReg() {
        return fecReg;
    }

    public void setFecReg(Date fecReg) {
        this.fecReg = fecReg;
    }

    public String getTipOpe() {
        return tipOpe;
    }

    public void setTipOpe(String tipOpe) {
        this.tipOpe = tipOpe;
    }

    public Usuario getUsuario() {
        return usuario;
    }

    public void setUsuario(Usuario usuario) {
        this.usuario = usuario;
    }

    public Raza getCodRaza() {
        return codRaza;
    }

    public void setCodRaza(Raza codRaza) {
        this.codRaza = codRaza;
    }

    public Especie getCodEspeci() {
        return codEspeci;
    }

    public void setCodEspeci(Especie codEspeci) {
        this.codEspeci = codEspeci;
    }

    public Distrito getCodDistri() {
        return codDistri;
    }

    public void setCodDistri(Distrito codDistri) {
        this.codDistri = codDistri;
    }

    public Color getCodColor() {
        return codColor;
    }

    public void setCodColor(Color codColor) {
        this.codColor = codColor;
    }

    public OrdenDeAtencionDeEmergencia getNumOae() {
        return numOae;
    }

    public void setNumOae(OrdenDeAtencionDeEmergencia numOae) {
        this.numOae = numOae;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codAni != null ? codAni.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AnimalMordedor)) {
            return false;
        }
        AnimalMordedor other = (AnimalMordedor) object;
        if ((this.codAni == null && other.codAni != null) || (this.codAni != null && !this.codAni.equals(other.codAni))) {
            return false;
        }
        return true;
    }
   
}
